/* 通用样式 */
body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 1200px;  /* 调整宽度以适应左侧的目录 */
    margin: 0 auto;
    padding: 45px;
    font-family: 'Poppins', sans-serif;
    background-color: #f0f0f5;
    transition: background-color 0.3s ease-in-out;
}

@media (max-width: 767px) {
    body { padding: 15px; }
}

/* 布局样式 */
.blog-detail-container {
    display: flex;
    align-items: flex-start;
    gap: 20px; /* 增加目录与主要内容之间的间距 */
}

/* 文章目录样式 */
.toc {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 300px;  /* 增加目录宽度 */
    flex: 0 0 300px;  /* 确保目录不会收缩 */
    position: sticky;
    top: 20px;
    max-height: 80vh;  /* 设置最大高度 */
    overflow-y: auto;  /* 超出部分自动隐藏，并提供滚动条 */
    transition: transform 0.3s ease-in-out;
}

.toc:hover {
    transform: translateX(10px);  /* 鼠标悬停时向右移动 */
}

.toc-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    color: #7255ff;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.toc-content {
    font-size: 16px;
    line-height: 1.8;
}

.toc-content a {
    display: block;
    color: #333;
    text-decoration: none;
    margin-bottom: 12px;  /* 增加项之间的间距 */
    transition: color 0.3s ease-in-out, text-decoration 0.3s ease-in-out;
}

.toc-content a:hover {
    text-decoration: underline;
    color: #7255ff;
}

.toc-content .toc-item {
    margin-left: 20px;
}

/* 博客详情样式 */
.blog-detail {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.blog-detail img {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.blog-detail h1 {
    margin: 0 0 20px 0;
    font-size: 28px;
}

.meta {
    display: flex;
    align-items: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.meta svg {
    margin-right: 5px;
}

.meta span {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.breadcrumb {
    margin-bottom: 20px;
    color: #999;
    font-size: 14px;
}

.breadcrumb a {
    color: #999;
    text-decoration: none;
    margin-right: 5px;
    transition: color 0.3s ease-in-out, text-decoration 0.3s ease-in-out;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: #7255ff;
}

.breadcrumb svg {
    margin: 0 5px;
}

.share {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease-in-out, text-decoration 0.3s ease-in-out;
}

.share a:hover {
    text-decoration: underline;
    color: #7255ff;
}

.comment-section {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.comment-section h2 {
    margin-bottom: 20px;
}

.comment-input {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.comment-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease-in-out;
}

.comment-input textarea:focus {
    border-color: #7255ff;
    outline: none;
}

.comment-input button {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: #7255ff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.comment-input button:hover {
    background-color: #5a3fcf;
}

.comments {
    margin-top: 20px;
}

.comment {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.comment img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    transition: transform 0.3s ease-in-out;
}

.comment:hover img {
    transform: scale(1.1);
}

.comment .comment-body {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    flex-grow: 1;
}

.comment .comment-body h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.comment .comment-body p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.comment-time {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

/* 代码块样式 */
pre code {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

pre code::before {
    content: ' ';
    display: block;
    height: 1em;
    width: 100%;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 1em;
}

pre code .hljs-keyword {
    color: #d73a49;
}

pre code .hljs-string {
    color: #032f62;
}

pre code .hljs-comment {
    color: #6a737d;
    font-style: italic;
}

pre code .hljs-built_in,
pre code .hljs-type {
    color: #6f42c1;
}

pre code .hljs-literal {
    color: #005cc5;
}

pre code .hljs-section,
pre code .hljs-title {
    color: #22863a;
}

pre code .hljs-attribute {
    color: #6f42c1;
}

